﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace Tweens4WPF
{
    public partial class Tweens4WPF
    {
        public static Hashtable TweensHash(params object[] args)
        {
            Hashtable ht = new Hashtable(args.Length / 2);
            if (args.Length % 2 != 0)
            {
                throw new Exception("Tweens4WPF error:  TweensHash requires an even number of arguments!");
            }
            else
            {
                for (int i = 0; i < args.Length - 1; i += 2)
                {
                    if (!Object.ReferenceEquals(args[i].GetType(), typeof(string)))
                    {
                        throw new Exception("Tweens4WPF error:  Odd term of TweensHash arguments' type should be String!");
                    }
                    ht.Add(args[i], args[i + 1]);
                }
                return ht;
            }

        }
    }
}
